<template>
    <div v-loading="infoLoading" class="page-header">
        <!-- <el-container> -->
            <!-- 面包屑导航栏和按钮组 -->
            <el-header style="box-shadow: rgba(0, 0, 0, 0.05) 0 2px 20px 0.5px;border-radius:6px;padding:20px;" v-if="role==1">
                <div class="flexBox" >
                    <el-breadcrumb separator="/">
                        <el-breadcrumb-item :to="{ path: '/home' }"
                        >首页</el-breadcrumb-item>
                        <el-breadcrumb-item :to="{ path: '/index' }">档案管理</el-breadcrumb-item>
                        <el-breadcrumb-item>个人信息</el-breadcrumb-item>
                    </el-breadcrumb>
                    <div style="display: flex">
                      <a href="http://47.106.96.172/file/档案模板.xlsx" style="text-decoration: none;margin-right: 10px" class="el-button el-button--mini">下载模板</a>
                      <el-upload style="margin-right: 10px" :show-file-list="false" action="#" :before-upload="handleBeforeUpload">
                        <el-button type="primary" size="mini" @click="">导入</el-button>
                      </el-upload>
                    </div>
                </div>
            </el-header>
            <el-container class="flexBox1">
            <!-- 侧边栏导航菜单 -->
            <el-aside width="200px" style="box-shadow: rgba(0, 0, 0, 0.05) 0 2px 20px 0.5px;border-radius:6px;position:relative">
              <div>
                   <div style="margin-top:20px">
<!--                         <img src="../assets/ju.png" style="width:60px;height:60px"> -->
<!--                        <el-avatar shape="square" :size="60" fit="cover" src="http://47.106.96.172:80/userHead/623a954f8fd03.png"></el-avatar>-->
                     <el-image :src="'http://47.106.96.172:80/userHead/'+form.headUrl" style="width: 80px;height: 80px;border-radius: 8px">
                       <div slot="error" class="imageError"
                            style="  width: 100%;
                                     height:100%;
                                     background-color: #f5f7fa;
                                     display: flex;
                                     align-items: center;
                                     justify-content: center;
                                     font-size: 20px;
                                      color: #909399">
                         <i class="el-icon-picture-outline"></i>
                       </div>
                     </el-image>
                        <div>姓名 : {{this.form.姓名}}</div>
                        <div>编号 : {{this.form.工号}}</div>
<!--                        <div>http://47.106.96.172:80/userHead/{{temp.headUrl}}</div>-->
                   </div>
               <el-divider></el-divider>
               <el-menu default-active="0" @select="handleSelect">
                  <el-menu-item index="0">个人信息</el-menu-item>
                  <el-menu-item v-for="(item,index) in dynamicList" :index="(index+1).toString()" v-if="item.enable=='true'">
                    {{item.name}}
                  </el-menu-item>
               </el-menu>
              </div>
            </el-aside>
            <!-- 信息表单 -->
            <el-main style="box-shadow: rgba(0, 0, 0, 0.05) 0 2px 20px 0.5px;border-radius:6px;margin-left:10px;margin-top:20px">
             <div v-if="showInfo==0">
<!--               TODO 上传图片-->
<!--               <el-avatar v-if="url" shape="square" :size="160" fit="fill" :src="'http://47.106.96.172:80/userHead/'+temp.headUrl" class="avatar"></el-avatar>-->
               <el-popover
                 v-if="edit=='3'&&temp.headUrl!=form.headUrl"
                 placement="top"
                 width="325"
               >
<!--                   <el-input :disabled="true" :value="temp.姓名" v-model="temp.姓名" class="rt-input"></el-input>-->
                   <el-image :src="'http://47.106.96.172:80/userHead/'+temp.headUrl" class="rt-input" style="width: 160px;height: 160px;border-radius: 8px">
                     <div slot="error"  style="  width: 100%;
                                     height:100%;
                                     background-color: #f5f7fa;
                                     display: flex;
                                     align-items: center;
                                     justify-content: center;
                                     font-size: 40px;
                                     color: #909399">
                       <i class="el-icon-picture-outline"></i>
                     </div>
                   </el-image>
                 <el-image slot="reference" class="popover" :src="'http://47.106.96.172:80/userHead/'+form.headUrl" style="width: 160px;height: 160px;border-radius: 8px">
                   <div slot="error"  style="  width: 100%;
                                     height:100%;
                                     background-color: #f5f7fa;
                                     display: flex;
                                     align-items: center;
                                     justify-content: center;
                                     font-size: 40px;
                                     color: #909399">
                     <i class="el-icon-picture-outline"></i>
                   </div>
                 </el-image>
               </el-popover>
               <el-image v-else :src="'http://47.106.96.172:80/userHead/'+form.headUrl" style="width: 160px;height: 160px;border-radius: 8px">
                 <div slot="error"  style="  width: 100%;
                                     height:100%;
                                     background-color: #f5f7fa;
                                     display: flex;
                                     align-items: center;
                                     justify-content: center;
                                     font-size: 40px;
                                     color: #909399">
                   <i class="el-icon-picture-outline"></i>
                 </div>
               </el-image>
               <el-upload
                 v-if="edit==2||edit==4"
                 ref="upload"
                 class="upload-demo"
                 action="http://47.106.96.172:80/upload.php"
                 :on-success="handleUploadSuccess"
                 :auto-upload="true"
                 :file-list="fileList"
                 list-type="picture">
                 <el-button size="small" type="primary">点击上传</el-button>
                 <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
               </el-upload>
               <el-dialog :visible.sync="dialogVisible" append-to-body>
                 <img width="100%" :src="dialogImageUrl" alt="">
               </el-dialog>
               <el-form :inline='true' label-position="right" label-width="100px" size="medium" ref="form" v-model="form">
                      <div class="title">
                          <i class="el-icon-suitcase" style="margin-right:10px"></i>基本信息</div>
                      <el-divider></el-divider>
                        <el-popover
                          v-if="edit=='3'&&temp.姓名!=form.姓名"
                          placement="top"
                          width="325"
                          >
                          <el-form-item>
                           <el-input :disabled="true" :value="form.姓名" v-model="form.姓名" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="姓名" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.姓名" v-model="temp.姓名"></el-input>
                          </el-form-item>
                        </el-popover>
                       <el-form-item label="姓名" prop="姓名" v-else class="is-required">
                           <el-input :disabled="edit=='1'||edit=='3'" :value="form.姓名" v-model="form.姓名"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.性别!=form.性别"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.性别" v-model="form.性别" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="性别" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.性别" v-model="temp.性别"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="性别" v-else>
                           <el-select :disabled="edit=='1'||edit=='3'" :placeholder="form.性别" v-model="form.性别">
                             <el-option value="男">男</el-option>
                             <el-option value="女">女</el-option>
                           </el-select>
                        </el-form-item>

                         <el-popover
                          v-if="edit=='3'&&temp.民族!=form.民族"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.民族" v-model="form.民族" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="民族" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.民族" v-model="temp.民族"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="民族" v-else>
                           <el-input :disabled="edit=='1'||edit=='3'" :value="form.民族" v-model="form.民族"></el-input>
                        </el-form-item>

                          <el-popover
                          v-if="edit=='3'&&temp.证件类型!=form.证件类型"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.证件类型" v-model="form.证件类型" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="证件类型" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.证件类型" v-model="temp.证件类型"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="证件类型" :value="form.证件类型" v-else>
                           <el-select :disabled="edit=='1'||edit=='3'" :value="form.证件类型" v-model="form.证件类型">
                             <el-option value="身份证">身份证</el-option>
                             <el-option value="其它">其它</el-option>
                           </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.证件号码!=form.证件号码"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.证件号码" v-model="form.证件号码" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="证件号码" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.证件号码" v-model="temp.证件号码"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="证件号码" :value="form.证件号码" v-else>
                           <el-input :disabled="edit=='1'||edit=='3'" :placeholder="form.证件号码" v-model="form.证件号码"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.出生日期!=form.出生日期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.出生日期" v-model="form.出生日期" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="出生日期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.出生日期" v-model="temp.出生日期"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="出生日期" :value="form.出生日期" v-else>
                           <el-date-picker :disabled="edit=='1'||edit=='3'" :placeholder="form.出生日期" v-model="form.出生日期"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.籍贯!=form.籍贯"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.籍贯" v-model="form.籍贯" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="籍贯" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.籍贯" v-model="temp.籍贯"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="籍贯" :value="form.籍贯" v-else>
                           <el-input :disabled="edit=='1'||edit=='3'" :value="form.籍贯" v-model="form.籍贯"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.国籍!=form.国籍"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.国籍" v-model="form.国籍" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="国籍" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.国籍" v-model="temp.国籍"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="国籍" :value="form.国籍" v-else>
                           <el-select :disabled="edit=='1'||edit=='3'" :placeholder="form.国籍" v-model="form.国籍">
                             <el-option value="中国">中国</el-option>
                             <el-option value="其它">其它</el-option>
                           </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.学历!=form.学历"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.学历" v-model="form.学历" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="学历" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.学历" v-model="temp.学历"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="学历" :value="form.学历" v-else>
                         <el-select :disabled="edit=='1'||edit=='3'" :placeholder="form.学历" v-model="form.学历">
                           <el-option value="中职">中职</el-option>
                           <el-option value="职高">职高</el-option>
                           <el-option value="专科">专科</el-option>
                           <el-option value="本科">本科</el-option>
                           <el-option value="硕士研究生">硕士研究生</el-option>
                           <el-option value="博士">博士</el-option>
                           <el-option value="其它">其它</el-option>
                         </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.学位!=form.学位"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.学位" v-model="form.学位" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="学位" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.学位" v-model="temp.学位"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="学位" v-else>
                           <el-input :disabled="edit=='1'||edit=='3'" :value="form.学位" v-model="form.学位"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.最高学历获取时间!=form.最高学历获取时间"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.最高学历获取时间" v-model="form.最高学历获取时间" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="最高学历获取时间" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.最高学历获取时间" v-model="temp.最高学历获取时间"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="最高学历获取时间" v-else>
                           <el-date-picker :disabled="edit=='1'||edit=='3'" :placeholder="form.最高学历获取时间" v-model="form.最高学历获取时间"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.毕业院校!=form.毕业院校"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.毕业院校" v-model="form.毕业院校" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="毕业院校" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.毕业院校" v-model="temp.毕业院校"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="毕业院校" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :placeholder="form.毕业院校" v-model="form.毕业院校"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.教育形式!=form.教育形式"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.教育形式" v-model="form.教育形式" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="教育形式" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.教育形式" v-model="temp.教育形式"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="教育形式" v-else>
                           <el-input :disabled="edit=='1'||edit=='3'" :placeholder="form.教育形式" v-model="form.教育形式"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.婚姻状况!=form.婚姻状况"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.婚姻状况" v-model="form.婚姻状况" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="婚姻状况" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.婚姻状况" v-model="temp.婚姻状况"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="婚姻状况" v-else>
                           <el-select :disabled="edit=='1'||edit=='3'" :placeholder="form.婚姻状况" v-model="form.婚姻状况">
                             <el-option value="已婚">已婚</el-option>
                             <el-option value="未婚">未婚</el-option>
                           </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.政治面貌!=form.政治面貌"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.政治面貌" v-model="form.政治面貌" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="政治面貌" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.政治面貌" v-model="temp.政治面貌"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="政治面貌" v-else>
                           <el-input :disabled="edit=='1'||edit=='3'" :placeholder="form.政治面貌" v-model="form.政治面貌"></el-input>
                        </el-form-item>
                  <div class="title">
                      <i class="el-icon-suitcase" style="margin-right:10px"></i>职业信息</div>
                  <el-divider></el-divider>


                        <el-popover
                          v-if="edit=='3'&&temp.科室!=form.科室"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.科室" v-model="form.科室" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="科室" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.科室" v-model="temp.科室"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="科室" v-else :prop="科室" class="is-required">
                          <el-select :disabled="edit=='1'||edit=='3'" clearable :value="form.科室" v-model="form.科室">
                            <el-option
                            v-for="item in deptList"
                            :value="item.label"
                            :label="item.label"
                            :key="item.value"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.人员性质!=form.人员性质"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.ryxz" v-model="form.ryxz" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="人员性质" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.ryxz" v-model="temp.ryxz"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="人员性质" v-else prop="ryxz" class="is-required">
                          <el-select :disabled="edit=='1'||edit=='3'" clearable :value="form.ryxz" v-model="form.ryxz" @change="getList(form.ryxz)">
                           <el-option
                            v-for="item in ryxzList"
                            :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.人员类别!=form.人员类别"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.人员类别" v-model="form.人员类别" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="人员类别" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.人员类别" v-model="temp.人员类别"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="人员类别" v-else class="is-required">
                          <el-select :disabled="edit=='1'||edit=='3'" :value="form.人员类别" v-model="form.人员类别">
                            <el-option
                            v-for="item in leibieList"
                            :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.聘任职称!=form.聘任职称"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.聘任职称" v-model="form.聘任职称" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="聘任职称" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.聘任职称" v-model="temp.聘任职称"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="聘任职称" v-else class="is-required">
                          <el-select :disabled="edit=='1'||edit=='3'" :value="form.聘任职称" v-model="form.聘任职称">
                            <el-option
                            v-for="item in titleList"
                            :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.人员层级!=form.人员层级"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.人员层级" v-model="form.人员层级" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="人员层级" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.人员层级" v-model="temp.人员层级"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="人员层级" v-else>
                          <el-select :disabled="edit=='1'||edit=='3'" :value="form.人员层级" v-model="form.人员层级">
                            <el-option
                            v-for="item in levelList"
                            :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.岗位类别!=form.岗位类别"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.岗位类别" v-model="form.岗位类别" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="岗位类别" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.岗位类别" v-model="temp.岗位类别"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="岗位类别" v-else class="is-required">
                          <el-select :disabled="edit=='1'||edit=='3'" :value="form.岗位类别" v-model="form.岗位类别">
                            <el-option
                            v-for="item in gangweiList"
                           :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.管理职务!=form.管理职务"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.管理职务" v-model="form.管理职务" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="管理职务" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.管理职务" v-model="temp.管理职务"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="管理职务" v-else class="is-required">
                          <el-select :disabled="edit=='1'||edit=='3'" :value="form.管理职务" v-model="form.管理职务">
                            <el-option
                            v-for="item in zhiwuList"
                            :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.从事专业!=form.从事专业"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.从事专业" v-model="form.从事专业" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="从事专业" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.从事专业" v-model="temp.从事专业"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="从事专业" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.从事专业" v-model="form.从事专业"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.岗位性质!=form.岗位性质"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.岗位性质" v-model="form.岗位性质" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="岗位性质" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.岗位性质" v-model="temp.岗位性质"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="岗位性质" v-else>
                          <el-select :disabled="edit=='1'||edit=='3'" :value="form.岗位性质" v-model="form.岗位性质">
                            <el-option
                            v-for="item in xzList"
                            :value="item.label"
                            :key="item.value"
                            :label="item.label"
                            >
                            </el-option>
                          </el-select>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.证件类型!=form.证件类型"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.执业证书编号" v-model="form.执业证书编号" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="执业证书编号" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.执业证书编号" v-model="temp.执业证书编号"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="执业证书编号" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.执业证书编号" v-model="form.执业证书编号"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.专科护士证书获取时间!=form.专科护士证书获取时间"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.专科护士证书获取时间" v-model="form.专科护士证书获取时间" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="专科护士证书获取时间" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.专科护士证书获取时间" v-model="temp.专科护士证书获取时间"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="专科护士证书获取时间" v-else>
                          <el-date-picker :disabled="edit=='1'||edit=='3'" :value="form.专科护士证书获取时间" v-model="form.专科护士证书获取时间"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.执业证书有效期!=form.执业证书有效期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.执业证书有效期" v-model="form.执业证书有效期" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="执业证书有效期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.执业证书有效期" v-model="temp.执业证书有效期"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="执业证书有效期" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.执业证书有效期" v-model="form.执业证书有效期"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.参加工作日期!=form.参加工作日期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.参加工作日期" v-model="form.参加工作日期" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="参加工作日期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.参加工作日期" v-model="temp.参加工作日期"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="参加工作日期" v-else>
                          <el-date-picker :disabled="edit=='1'||edit=='3'" :value="form.参加工作日期" v-model="form.参加工作日期"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.来院日期!=form.来院日期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.来院日期" v-model="form.来院日期"  class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="来院日期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.来院日期" v-model="temp.来院日期"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="来院日期" v-else>
                          <el-date-picker :disabled="true" :value="form.来院日期" v-model="form.来院日期"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.人事状态!=form.人事状态"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.人事状态" v-model="form.人事状态" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="人事状态" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.人事状态" v-model="temp.人事状态"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="人事状态" v-else>
                          <el-input :disabled="true" :value="form.是否离职" v-model="form.是否离职"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.返聘时间!=form.返聘时间"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.返聘时间" v-model="form.返聘时间" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="返聘时间" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.返聘时间" v-model="temp.返聘时间"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="返聘时间" v-else>
                          <el-date-picker :disabled="true" :value="form.返聘时间" v-model="form.返聘时间"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.工龄!=form.工龄"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.工龄" v-model="form.工龄" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="工龄" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.工龄" v-model="temp.工龄"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="工龄" v-else>
                          <el-input :disabled="true" :value="form.工龄" v-model="form.工龄" ></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.院龄!=form.院龄"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.院龄" v-model="form.院龄" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="院龄" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.院龄" v-model="temp.院龄"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="院龄" v-else>
                          <el-input :disabled="true" :value="form.院龄" v-model="form.院龄"></el-input>
                        </el-form-item>

                         <el-popover
                          v-if="edit=='3'&&temp.当前职称晋升日期!=form.当前职称晋升日期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.当前职称晋升日期" v-model="form.当前职称晋升日期" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="当前职称晋升日期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.当前职称晋升日期" v-model="temp.当前职称晋升日期"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="当前职称晋升日期" v-else>
                          <el-date-picker :disabled="true" :value="form.当前职称晋升日期" v-model="form.当前职称晋升日期"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.当前职务晋升日期!=form.当前职务晋升日期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.当前职务晋升日期" v-model="form.当前职务晋升日期" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="当前职务晋升日期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.当前职务晋升日期" v-model="temp.当前职务晋升日期"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="当前职务晋升日期" v-else>
                          <el-date-picker :disabled="true" :value="form.当前职务晋升日期" v-model="form.当前职务晋升日期"></el-date-picker>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.当前层级晋升日期!=form.当前层级晋升日期"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.当前层级晋升日期" v-model="form.当前层级晋升日期" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="当前层级晋升日期" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.当前层级晋升日期" v-model="temp.当前层级晋升日期"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="当前层级晋升日期" v-else>
                          <el-date-picker :disabled="true" :value="form.当前层级晋升日期" v-model="form.当前层级晋升日期"></el-date-picker>
                        </el-form-item>
                  <div class="title">
                      <i class="el-icon-suitcase" style="margin-right:10px"></i>联系信息</div>
                  <el-divider></el-divider>
                        <el-popover
                          v-if="edit=='3'&&temp.手机号码!=form.手机号码"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.手机号码" v-model="form.手机号码" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="手机号码" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.手机号码" v-model="temp.手机号码"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="手机号码" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.手机号码" v-model="form.手机号码"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.联系人单位!=form.联系人单位"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.联系人单位" v-model="form.联系人单位" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="联系人单位" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.联系人单位" v-model="temp.联系人单位"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="联系人单位" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.联系人单位" v-model="form.联系人单位"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.联系人地址!=form.联系人地址"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.联系人地址" v-model="form.联系人地址" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="联系人地址" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.联系人地址" v-model="temp.联系人地址"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="联系人地址" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.联系人地址" v-model="form.联系人地址"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.办公电话!=form.办公电话"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.办公电话" v-model="form.办公电话" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="办公电话" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.办公电话" v-model="temp.办公电话"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="办公电话" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.办公电话" v-model="form.办公电话"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.邮编!=form.邮编"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.邮编" v-model="form.邮编" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="邮编" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.邮编" v-model="temp.邮编"></el-input>
                          </el-form-item>
                        </el-popover>
                         <el-form-item label="邮编" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.邮编" v-model="form.邮编"></el-input>
                        </el-form-item>

                        <el-popover
                          v-if="edit=='3'&&temp.邮箱!=form.邮箱"
                          placement="top"
                          width="325"
                          v-model="visible">
                          <el-form-item>
                           <el-input :disabled="true" :value="form.邮箱" v-model="form.邮箱" class="rt-input"></el-input>
                          </el-form-item>
                          <el-form-item label="邮箱" slot="reference" class="popover">
                           <el-input :disabled="true" :value="temp.邮箱" v-model="temp.邮箱"></el-input>
                          </el-form-item>
                        </el-popover>
                        <el-form-item label="邮箱" v-else>
                          <el-input :disabled="edit=='1'||edit=='3'" :value="form.邮箱" v-model="form.邮箱"></el-input>
                        </el-form-item>

                  <div class="title">
                      <i class="el-icon-suitcase" style="margin-right:10px"></i>个人简介</div>
                  <el-divider></el-divider>
                        <el-form-item style="width:100% !important">
                        <el-input
                            type="textarea"
                            :autosize="{ minRows: 2, maxRows: 4}"
                            placeholder="请输入内容"
                            v-model="form.textarea1"
                            :disabled="edit=='1'||edit=='3'"
                            style="width:1348px"
                            >
                        </el-input>
                        </el-form-item>
                  <div class="title">
                      <i class="el-icon-suitcase" style="margin-right:10px"></i>备注信息</div>
                      <el-divider></el-divider>
                        <el-form-item style="width:100% !important">
                         <el-input
                            type="textarea"
                            :autosize="{ minRows: 2, maxRows: 4}"
                            placeholder="请输入内容"
                            v-model="form.textarea2"
                            :disabled="edit=='1'||edit=='3'"
                             style="width:1348px">
                        </el-input>
                        </el-form-item>
               </el-form>
               <div>
                    <el-button size="mini" type="primary" @click="save" v-if="edit=='2'||edit=='4'">保存</el-button>
                    <el-button size="mini" type="primary" @click="save_temp" v-if="edit=='3'">通过</el-button>
                    <el-button size="mini" type="danger" @click="deny_temp" v-if="edit=='3'">否决</el-button>
                    <el-button size="mini" @click="cancle" v-if="role==1">返回</el-button>
                </div>
             </div>
             <div v-else>
               <formConfig3
                            :LayoutJSON="JSON.parse(dynamicList[showInfo-1].layoutJSON)"
                            :editObject="editObject"
                            ref="formConfig"
                            @view="addDynamicList">
               </formConfig3>
               <el-divider></el-divider>
               <div style="margin: 10px 0">
                 <el-alert
                   :title="dynamicList[showInfo-1].name"
                   type="info"
                   :description="dynamicList[showInfo-1].desc"
                   show-icon
                   :closable="false"
                   center
                   style="text-align: center"
                 >
                 </el-alert>
               </div>
               <div>
                 <el-button size="mini" type="primary" @click="addDynamic" v-if="(edit=='2'||edit=='4')&&dynamicList[showInfo-1].layoutJSON!=null&&editObject!='2'">新增</el-button>
                 <el-button size="mini" type="primary" @click="saveDynamic" v-if="editObject=='2'">保存</el-button>
                 <el-button size="mini"  @click="cancleDynamic" v-if="editObject=='2'">返回</el-button>
               </div>
             </div>
            </el-main>
              <template>
                <el-backtop target=".page-header .flexBox1"></el-backtop>
              </template>
            </el-container>
            <el-dialog :title="'是否'+aduitMessage+'审核？'" width="500px" :visible.sync="dialogPass" :append-to-body='true'>
              <el-form :model="passForm">
                <el-form-item v-if="isPass" label="拒绝原因:">
                  <el-select clearable filterable v-model="passForm.suggestType" placeholder="请选择">
                    <el-option
                      v-for="item in reAuidtList"
                      :label="item.name"
                      :key="item.id"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="描述备注:" class="textarea" style="width:100%">
                  <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="passForm.suggest"></el-input>
                </el-form-item>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button size="mini" type="primary"  @click="passExamine">确 定</el-button>
                <el-button size="mini" @click="dialogPass = false">取 消</el-button>
              </div>
            </el-dialog>
        <!-- </el-container> -->
    </div>
</template>
<script>
import TaskManager from '../service/TaskManager'
import dynamic from '../components/dynamic.vue';
import formConfig3 from "../components/formConfig3";
import axios from "axios";
import XLSX from "xlsx";
export default {
  components: { formConfig3, dynamic },
  name: "info",
  data() {
    return {
            /**
             * type:
             * 1:单选框
             * 2:多选框
             * 3:选择框
             * 4:datePicker
             */
            editObject:1,
            role:"",
            dialogImageUrl:"",
            dialogVisible: false,
            fileList:[],
            file:new FormData(),
            reAuidtList:[
              {name:'内容不符合实际情况',id:"0",value:'内容不符合实际情况'},
              {name:'存在虚假内容',id:"1",value:'存在虚假内容'},
              {name:'其它',id:"2",value:'其它'},
              ],
            dynamicList:[],
            isPass:false,
            passForm:{suggestType:''},
            aduitMessage:'',
            dialogPass:false,
            // url:"https://pic2.zhimg.com/v2-e033acbeacba3cd43e4874b1fa34afc8_r.jpg?source=1940ef5c",
            url:"http://47.106.96.172:80/userHead/623a82c842c57.png",
            headUrl:"",
            infoLoading:false,
            isUpload:false,
            deptList:[],
            zhiwuList:[],
            titleList:[],
            levelList:[],
            xzList:[],
            gangweiList:[],
            leibieList:[],
            ryxzList:[],
            edit:"",
            data:"",
            temp:{},
            showInfo:0,
            form:{},
            attributeItem:{},
            rules:{
              姓名:[
                {required:true,message:"请输入姓名",trigger:"change"},
                {min:2,max:10,message:"请输入2-10个字",trigger:"change"}
              ],
              '科室':[
                {required:true,message:"请选择科室",trigger:"change"},
              ],
              'ryxz':[
                {required:true,message:"请选择人员性质",trigger:"change"},
              ],

            }
        }
    },
    methods:{
      handleUpload(file){
        if(file){
          this.getBase64(file, (imageUrl) => {
            // file的url设置主要作用是,上传框中的预览
            imageUrl=this.dataURLtoBlob(imageUrl)
            // file.url = imageUrl
            this.fileList.push({name:file.name,url:imageUrl})
            console.log(imageUrl,"-------fileList-------")
          })
          return false
        }else{
          return false;
        }
      },
      handleUploadSuccess(res,file,fileList){
        console.log(res,"res")
        this.headUrl=res
        this.isUpload=true
      },
      getBase64 (img, callback) {
        const reader = new FileReader()
        reader.addEventListener('load', () => callback(reader.result))
        reader.readAsDataURL(img)
      },
      dataURLtoBlob(url) {
        let arr = url.split(','),
          mime = arr[0].match(/:(.*?);/)[1],
          bstr = atob(arr[1]), n = bstr.length,
          u8arr = new Uint8Array(n);
        while (n--) {
          u8arr[n] = bstr.charCodeAt(n);
        }
        return new Blob([u8arr], {type: mime});
      },
      fnUpload(file,filelist){
        // TaskManager.uploadImg({url:file.url,id:this.form.工号})
        // TaskManager.uploadImg({url:this.file})
        // this.$refs.upload.submit();
        console.log(this.headUrl,"headurl")
      },
      addDynamicList(val){
          this.editObject=2;
      },
      addDynamic(){
        this.editObject=2;
        this.$refs.formConfig.attributeJSON={};
      },
      cancleDynamic(){
        this.editObject=1;
        this.$refs.formConfig.disabled=false;
        this.handleSelect(this.showInfo);
      },
      handleSelect(index){
        this.showInfo=index;
        if(this.showInfo!=0){
          // console.log(this.dynamicList[this.showInfo-1].name)
          TaskManager.getDynamicForm({id:this.form.工号,name:this.dynamicList[this.showInfo-1].name,status: 2}).then((res)=>{
            let data=[]
            // console.log(res);
            if(res.data!="ERROR!"){
              res.data.forEach(e=>{
                e=JSON.parse(e.attributeJSON);
                data.push(e);
              })
              this.$refs.formConfig.tableData=data;
              this.$refs.formConfig.showTable=false;
            }else{
              this.$refs.formConfig.tableData=[];
              this.$refs.formConfig.showTable=false;
            }
          })
        }
      },
      cancle(){
          this.$confirm('是否返回?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
          }).then(()=>{
             this.$router.go(-1);
          }).catch(() => {
        });
      },
      saveDynamic(){
            this.$refs.formConfig.showTable=true;
            this.attributeItem.attributeJSON=this.$refs.formConfig.attributeJSON;
            this.attributeItem.belongTo=this.dynamicList[this.showInfo-1].name;
            this.attributeItem.id=this.form.工号;
            console.log(this.attributeItem);
            let params={
              status:0,
              id:this.attributeItem.id,
              belongTo:this.attributeItem.belongTo,
              attributeJSON:JSON.stringify(this.attributeItem.attributeJSON),
            }
            TaskManager.saveDynamic(params).then((res)=>{
              if(res.data=='success'){
                this.$message({
                  type:"success",
                  message:"保存成功！"
                })
                this.$refs.formConfig.showTable=false;
              }
            })
      },
      getTime(){
        let date=new Date().toLocaleString().split(' ')[0];
        let time=new Date().toLocaleString().split(' ')[1];
        let Now=date+" "+time;
        return Now;
      },
      passExamine(){
        this.infoLoading=true;
        this.dialogPass=false;

        TaskManager.addUser_temp({...this.temp,headUrl:this.temp.headUrl}).then((res)=>{
          console.log(res)
          if(res.data=='success'){
            this.$message({
              message: '审核提交成功！',
              type: 'success'
            });
            let params={
              state:0,
              id:this.form.工号,
              name:window.localStorage.name,
              dept:window.localStorage.dept,
              handle:'通过审核',
              time:this.getTime()
            }
            let paramss={
              name:"档案审核通知",
              message:`您的档案已被【${window.localStorage.dept}-${window.localStorage.name}】通过，如有需要请查看`,
              date:this.getTime(),
              id:this.form.工号
            }
            if(this.isPass){
              params.handle='否决审核'
              paramss.message=`您的档案已被【${window.localStorage.dept}-${window.localStorage.name}】否决，请尽快修改`
            }
            TaskManager.getHandleHistory(params);
            TaskManager.setMessage(paramss);
            this.$router.go(-1);
            this.infoLoading=false;
          }else{
            this.$message({
              message: '审核提交失败！',
              type: 'error'
            });
            this.infoLoading=false;
          }
       })
      },
     save(){
         // console.log(this.form.姓名!=undefined&&this.form.科室!=undefined&&this.form.ryxz!=undefined)
         // console.log(this.form.姓名,this.form.科室,this.form.ryxz)
        if(this.form.姓名!=undefined&&this.form.科室!=undefined&&this.form.ryxz!=undefined){
          this.infoLoading=true;
          this.fnUpload();
          // console.log(this.headUrl,"headurl222")
          if(this.edit=='2'){
            TaskManager.addUser({...this.form,headUrl:this.headUrl}).then((res)=>{
              console.log(res)
              if(res.data=='success'){
                this.$message({
                  message: '修改成功',
                  type: 'success'
                });
                this.infoLoading=false;
                let params={
                  state:0,
                  id:this.form.工号,
                  name:window.localStorage.name,
                  dept:window.localStorage.dept,
                  handle:'编辑修改',
                  time:this.getTime()
                }
                TaskManager.getHandleHistory(params);
              }else{
                this.$message({
                  message: '修改失败',
                  type: 'error'
                });
                this.infoLoading=false;
              }
            })
          }else{
            TaskManager.addUser({...this.form,headUrl:this.temp.headUrl}).then((res)=>{
              // console.log(res)
              if(res.data=='success'){
                this.$message({
                  message: '人员添加成功',
                  type: 'success'
                });

                let _params={
                  id:this.form.工号,
                  name:this.form.姓名,
                  dept:this.form.科室,
                  password:'1234',
                  create:this.getTime()
                }
                TaskManager.addLoginUser(_params);
                let params={
                  state:0,
                  id:this.form.工号,
                  name:window.localStorage.name,
                  dept:window.localStorage.dept,
                  handle:'成功添加',
                  time:this.getTime()
                }
                TaskManager.getHandleHistory(params);
                this.infoLoading=false;
                this.$router.go(-1);
              }else{
                this.$message({
                  message: '人员添加失败',
                  type: 'error'
                });
                this.infoLoading=false;
              }
            })
          }
        }else{
          this.$message({
            type:'error',
            message:'姓名、科室、人员性质不能为空！请修改后再进行相应操作'
          })
        }
      },
      save_temp(){
        this.dialogPass=true;
        this.isPass=false;
        this.aduitMessage='通过';
      },
      deny_temp(){
        this.dialogPass=true;
        this.isPass=true;
        this.aduitMessage='否决';
      },
      unEmpty(arr){
        for(let key in arr){
          if(arr[key][0]==''){
            arr.splice(key,1);
          }
        }
      },
      getDeptList(){
        TaskManager.getDictionary({temp:'dept'}).then((res=>{
          this.deptList=res.data;
        }))
      },
      getRyxzList(){
        TaskManager.getDictionary({temp:'ryxz'}).then((res=>{
          this.ryxzList=res.data;
        }))
      },
      getLevelList(ryxz){
        TaskManager.getDictionary({temp:'hljb'}).then((res=>{
          this.levelList=res.data;
        }))
      },
      getTitleList(ryxz){
        TaskManager.getDictionary({temp:'przc'}).then((res=>{
          this.titleList=res.data;
        }))
      },
      getZhiwuList(ryxz){
        TaskManager.getDictionary({temp:'glzw'}).then((res=>{
          this.zhiwuList=res.data;
        }))
      },
      getLeibieList(){
        TaskManager.getDictionary({temp:'rylb'}).then((res=>{
          this.leibieList=res.data;
        }))
      },
      getXzList(){
        TaskManager.getDictionary({temp:'gwxz'}).then((res=>{
          this.xzList=res.data;
        }))
      },
      getGangweiList(ryxz){
        TaskManager.getDictionary({temp:'gwlb'}).then((res=>{
          this.gangweiList=res.data;
        }))
      },
      getAllList(){
        this.getDeptList();
        this.getRyxzList();
        this.getLevelList(this.form.ryxz);
        this.getTitleList(this.form.ryxz);
        this.getZhiwuList(this.form.ryxz);
        this.getLeibieList(this.form.ryxz);
        this.getXzList();
        this.getGangweiList();
      },
      getList(name){
        console.log(name)
        this.getLevelList(name);
        this.getTitleList(name);
        this.getZhiwuList(name);
        this.getGangweiList(name);
      },
      getDynamicList() {
        TaskManager.getDynamicForm({status:0}).then((res)=>{
          this.dynamicList=res.data;
          console.log(res.data)
        })
      },
      getOwnData(){
        let params={
          dept:window.localStorage.dept,
          name:window.localStorage.id,
          outgoing:'',
          offset:1,
          rowsOfPage:20,
          ryxz:'',
          state:'',
          status:'在职'
        }
        TaskManager.getList(params).then(res=>{
          this.form=res.data.data[0]
          console.log(this.data,"data")
        })
      },
      getDict(type){
        TaskManager.getDict({type:type}).then(res=>{
          return res;
        })
      },
      handleBeforeUpload(file){
        let wb,rABS=true
        // if(!obj.files) {
        //   return;
        // }
        console.log(file)
        var f = file;
        var reader = new FileReader();
        reader.onload = (e) =>{
          var data = e.target.result;
          if(rABS) {
            wb = XLSX.read(btoa(this.fixdata(data)), {//手动转化
              type: 'base64'
            });
          } else {
            wb = XLSX.read(data, {
              type: 'binary'
            });
          }
          this.form=XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])[0]
        };
        if(rABS) {
          reader.readAsArrayBuffer(f);
        } else {
          reader.readAsBinaryString(f);
        }
      },
      fixdata(data) { //文件流转BinaryString
        var o = "",
          l = 0,
          w = 10240;
        for(; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));
        o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));
        return o;
      },
    },
    mounted(){
      // console.log((this.edit=='2'||this.edit=='4')&&this.dynamicList[this.showInfo-1].layoutJSON!=null&&this.editObject!='2','rf')
      this.infoLoading=true;
      this.role=window.localStorage.role;
      //edit 1查看 2编辑 3审核 4新增
      // console.log(this.edit=='1'||this.edit=='3',"boolean")
      if(this.$route.params.edit!=undefined&&this.$route.params.data!=undefined){
        this.edit=this.$route.params.edit;
        // this.id=this.$route.params.data;
        if(this.edit!=4){
          TaskManager.getInfo({id:this.$route.params.data}).then((res)=>{
            this.form=res.data[0]
            console.log(this.form,"form")
          }).catch(()=> {
          })
        }else{
          let id=parseInt(Math.random()*10000)
          this.form.工号="JYYH"+id
          this.form.档案编号="JYYHBH"+id
        }
        // this.form=this.data;
        if(this.edit==3){
          TaskManager.getExamineList({id:this.$route.params.data}).then((res)=>{
            this.temp=res.data[0];
            console.log(this.temp,"temp")
          }).catch(()=>{

          })
        }else{
          this.infoLoading=false;
        }
      }
      else {
        this.edit = '2';
        // if(this.role==0){
        this.getOwnData();
        // }
      }
      // let params={id:this.form.工号}
      // TaskManager.getExamineList(params).then((res)=>{
      //   this.temp=res.data[0];
      //   console.log(this.temp,"temp")
      //   this.infoLoading=false;
      // }).catch(()=>{
      //   this.infoLoading=false;
      // })
      // if(this.edit!=3){
      //     if(this.edit==1||this.edit==2){
      //       TaskManager.getInfo({id:this.$route.params.data}).then((res)=>{
      //
      //       })
      //     }else{
      //
      //     }
      // }else{
      //
      // }
      this.infoLoading=false;
      this.getDynamicList();
      this.getAllList();
      // this.ryxzList=this.getDict('jyxs');
    }
}
</script>
<style scoped>
.el-form-item{
  margin:0 60px 20px 0 !important;
}
.el-aside{
    background-color: white;
    margin-top: 20px;
}
.flexBox1{
  display: flex;
  justify-content: space-between;
  align-items: top;
  flex-wrap: nowrap;
}
.title{
    color: #409EFF;
    font-size: 14px;
    font-weight: bold;
    margin: 24px 0;
}
.el-input__inner {
    width: 300px !important;
}
.el-input {
    width: 300px !important;
}
.el-select{
    width: 300px;
}
.el-table__header{
  background-color: royalblue !important;
}
.el-form-item__label{
    display:inline-block;
    width:100px;
    text-align:right;
}
.popover{
  border:deeppink 1px dashed;
  /* background-color: rgba(255, 0, 0, 0.5); */
  padding: 6px;
  border-radius: 4px;
}
/deep/.el-popover{
  display: flex;
  justify-content: center;
}
.el-input.is-disabled .el-input__inner {
  background-color: #F5F7FA;
  border-color: #E4E7ED;
  /* color: #C0C4CC; */
  cursor: not-allowed;
}
/deep/.el-input.is-disabled .el-input__inner {
  background-color: #F5F7FA;
  border-color: #E4E7ED;
  color: black;
  cursor: not-allowed;
}
/deep/.el-select .el-input.is-disabled .el-input__inner {
  cursor: not-allowed;
  color: black;
  background-color: #F5F7FA
}
/*.rt-input /deep/ .el-input__inner {*/
/*  border: deepskyblue 1px solid;*/
/*  color: gray;*/
/*}*/
</style>
